
public class arrTest {

	public static void main(String[] args) {
		String[] arr = new String[]{"22","qq","ww","mm","gg","boom","zi"};
		String[] arr2 = new String[arr.length];
		
		// 数组复制
		for(int i=0;i<arr2.length;++i){
			arr2[i] = arr[i];
		}
		
		// 数组反向
		String temp;
		
			// 方法一
//		for(int i = 0; i< arr2.length/2;i++){
//			temp = arr2[i];
//			arr2[i] = arr2[arr2.length-1-i];
//			arr2[arr2.length-1-i]=temp;
//		}
			// 方法二
		for(int i = 0,j =arr2.length-1 ; i < j;i++,j--){
			temp = arr2[i];
			arr2[i] = arr2[j];
			arr2[j]=temp;
		}
		
		// 输出
		for(int i=0;i<arr2.length;i++)System.out.print(arr[i]+"  ");
		System.out.println();
		for(int i=0;i<arr2.length;i++)System.out.print(arr2[i]+"  ");
	}
}
